<div style="min-height: 300px; padding-bottom: 20px; width: 98%; float: left" class="portlet x12">
	<div class="portlet-header">
		<h4>Danh sách link liên kết

		<div class="buttonrow" style="float: right; margin-right: 20px;">
		<a href="<?php echo base_url ();?>admin/links/form_add_link">
				<input type="button" value="Thêm link" class="btn btn-orange">
		</a>
		</div>
		</h4>

	</div>	<!-- .portlet-header -->

		<table>

		 <!-- them phan header -->
		 <thead>
				<tr>
					<th style="width: 30%;">Tên links</th>
					<th>Hình ảnh</th>
					<th>Type</th>
					<th>Chức năng</th>
				</tr>
			</thead>
		<!-- ket thuc them head -->

		<?php foreach($list as $row_link) {
             $id = $row_link['id'];
			 $ten = $row_link['ten_link'];
			 $type = $row_link['type'];
			 echo '<tr>';
			 echo '<td>'.$ten.'</td>';
			 ?>
			 <td><img src="<?php echo base_url (); ?>application/storage/images/<?php echo $row_link['file_name']; ?>" /></td>
			 <?php
			 echo '<td>'.$type.'</td>';


			?>
		       <!-- dua button xoa, sua ra -->
				<td>
				<input type="button" value="Sửa" class="btn btn-red"
					onclick="sua_item('<?php echo $id;?>')">
				<input type="button" value="Xóa" class="btn btn-green"
					onclick="del_item('<?php echo $id;?>')">
			    </td>

				<script>
				function del_item(id){
						var store_del = confirm("Xoa link nay ?");
					if(store_del==true){
						window.location="<?php echo base_url();?>admin/links/xoalink/"+id;
					}else{
						return false;
					}
				}

				function sua_item(id){
				 window.location="<?php echo base_url();?>admin/links/form_sua_link/"+id;
				}
				</script>

				<!-- ket thuc dua button xoa, sua -->

        <?php  } ?>
			  </tr>

		</table>


</div>	<!-- .portlet x12 -->